/**
 * admui-basic v2.1.0 (http://www.admui.com/)
 * Copyright 2015-2019 Admui Team
 * Licensed under the Admui License 1.1 (http://www.admui.com/about/license)
 */
(function(window, document, $) {
  'use strict';

  window.App.extend({
    run: function() {
      var t = $('#dataTableExample').DataTable($.concatCpt('dataTable'));
      var counter = 1;

      $('#admui-pageContent').on('click', '#DTAddRow', function() {
        t.row
          .add([counter + '.1', counter + '.2', counter + '.3', counter + '.4', counter + '.5'])
          .draw(false);

        counter += 1;
      });

      // 自动添加第一行的数据
      $('#DTAddRow').click();
    }
  });

  window.App.run();
})(window, document, jQuery);
